package cn.edu.hunau.common;

import com.sun.net.httpserver.Authenticator;

/**统一的业务异常
 * @author hb
 * @date 2024-04-15 11:29:15
 */
public class BusinessException extends RuntimeException {
    private Integer code;



    public BusinessException(Integer code) {
        this.code = code;
    }

    public BusinessException(ResultCodeEnum codeEnum) {
        super(codeEnum.getMessage());
        this.code = codeEnum.getCode();
    }

    public BusinessException(String message, Integer code) {
        super(message);
        this.code = code;
    }

    public BusinessException(String message, Throwable cause, Integer code) {
        super(message, cause);
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
